package com.example.cinema.bindingdata;

import android.view.View;
import android.widget.ImageView;

import androidx.databinding.BindingAdapter;
import androidx.databinding.ObservableField;

import com.bumptech.glide.Glide;
import com.example.cinema.drawview.CollapseText;

public class CircleItemData {

    @BindingAdapter("circleurl")
    public static void setImageURL(View view,String url)
    {
        if(view == null)
        {
            return;
        }
        Glide.with(view).load(url).into((ImageView) view);
    }

    @BindingAdapter("settextcontext")
    public static void settext(View view,String msg)
    {
        CollapseText ctext = (CollapseText) view;
        ctext.setTextcontext(msg);
    }

    public ObservableField<String> userimage = new ObservableField<>();//回帖头像
    public ObservableField<String> username = new ObservableField<>();//回帖用户
    public ObservableField<String> usertimes = new ObservableField<>();//回帖时间
    public ObservableField<String> zannumbes = new ObservableField<>();//点赞数
    public ObservableField<String> msgcontext = new ObservableField<>();//回帖内容
    public ObservableField<String> usersid = new ObservableField<>();//用户ID
}
